<?php
namespace app\admin\controller;
use think\Request;
use think\Db;
/**
 * 
 * @author 时
 * @description 教室评价控制器
 * @由于是在进入房间进行白板教学一定要继承用户账号注册 登录
 *
 */
class RoomEvulation extends Base{
    public function index()
    {
        $user_id=input('get.user_id');
        $user_id=empty($user_id)?'1':$user_id;
        $room_id=input('get.room_id');
        $room_id=empty($room_id)?"10865520":$room_id;
        $roomer_id=input('get.roomer_id');
        $roomer_id=empty($roomer_id)?'2':$roomer_id;
        $data=array('user_id'=>$user_id,'room_id'=>$room_id,'roomer_id'=>$roomer_id);
        if(Request::instance()->isGet()){
          
           $this->assign('roominfo',$data);
            return view('room_evulation');
        }else
        {
          
            $evaluation=input('post.evaluation');
           
            $content=input('post.content');
            $data['evaluation']=$evaluation;
            $data['content']=$content;
            $id=Db::table('zx_room_evaluation')->insertGetId($data);
            if($id){
                $this->success('操作成功');
            }else {
                $this->error('操作失败');
            }
        }
 
  
    }
    
}